/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pnt.message;

import java.net.InetSocketAddress;
import pnt.message.objects.*;

/**
 *
 * @author andrew
 */
public class Request_AllocateHEP extends Request {

    int hepcountrequest;
    User from;
    InetSocketAddress pvtendpoint;
    
    public Request_AllocateHEP( int transaction,
		                        int hepcountrequest, 
		                        User from, 
		                        InetSocketAddress pvtendpoint){
        super(transaction,Request.RequestType.ALLOCATE_HEP);
        this.hepcountrequest = hepcountrequest;
        this.from = from;
        this.pvtendpoint = pvtendpoint;
    }
    
    
    @Override
    public String toString(String endChar, String term) {
        
        String s  = "ALLOCATE-HEP * PNT/1.0" + endChar +
                    "Transaction: " + getTransactionNumber() + endChar +
                    "Hep-Count-Request: " + hepcountrequest + endChar +
                    "From: " + from.toString() + endChar +
                    "Pvt-Endpoint: " + Utils.formatSocketAddress(pvtendpoint) + term;
             
        return s;
    }

    @Override
    public byte[] toBytes() {
        throw new UnsupportedOperationException("Not supported yet.");
    }


	public int getHepcountrequest() {
		return hepcountrequest;
	}


	public User getFrom() {
		return from;
	}


	public InetSocketAddress getPvtendpoint() {
		return pvtendpoint;
	}

}
